package com.gp.entity;


import lombok.Data;

/**
 * @Date 2024/4/26 10:26
 * @Author BigPotato743
 * @Email 2764826228@qq.com
 * @Phone 17623386574
 */
@Data
public class Result<T> {

    private int statusCode;
    private String message;
    private T data;

    public Result(){
        this.statusCode = 0;
        this.message = null;
        this.data = null;
    }
    public Result(int statusCode, String message, T data) {
        this.statusCode = statusCode;
        this.message = message;
        this.data = data;
    }

    public Result(int statusCode, String message) {
        this.statusCode = statusCode;
        this.message = message;
        this.data = null;
    }

    public static <T> Result<T> success(T data) {
        return new Result(200, "操作成功！", data);
    }
}

